// 消息页面相关接口
import type { ResMessageList, Unread } from '@/types/message'
import http from '@/utils/http'

export enum API {
  // 消息列表
  MESSAGE_LIST = '/message/messageList',
  // 未读消息
  UNREAD_MESSAGE = '/message/unread'
}

/**
 * 获取消息列表
 * @param page 页面
 * @param size 条数
 * @returns
 */
export const reqMessageList = (page = 1, size = 10) => {
  return http.get<any, ResMessageList>(API.MESSAGE_LIST, {
    params: {
      page,
      size
    }
  })
}

/**
 * 获取未读消息
 * @returns
 */
export const reqUnreadMessage = () => {
  return http.get<any, Unread>(API.UNREAD_MESSAGE)
}
